package com.hushi.test;

import com.hushi.config.Springcfg;
import com.hushi.dao.CustomerDao;
import com.hushi.impl.CustomerServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;

/**
 * 测试零配置使用junit
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = Springcfg.class)
public class Demo1 {
    @Resource
    private CustomerDao customerDaoImpl;
    @Test
    public void test(){
        customerDaoImpl.save();
    }
}